package com.example.jdbc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class PageController {

    /**
     * 跳转到templates中
     * 跳转页面使用@RequestMapping 因为跳转的既有post 也有 get
     * @param page
     * @return
     */
    @RequestMapping("/{page}")
    public ModelAndView page(@PathVariable String page){
        return new ModelAndView(page);
    }
}
